Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes job handling in gitops controller #2903

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

0xavi0
Copy link
Contributor

@0xavi0 0xavi0 commented Sep 26, 2024

Changes the job handling so jobs are deleted after they succeed. Jobs are created when they are needed, this avoids having always a minimum of 1 job per gitrepo resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting the controller reference when creating the job and the Owns statement makes extra reconciler calls that are not needed.

Refers to #2870

@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 4 times, most recently from b12b7b9 to d2a85d8 Compare September 26, 2024 14:03
@manno manno changed the title Changes job handling in gitopts controller Changes job handling in gitops controller Sep 27, 2024
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 3 times, most recently from d496fa9 to e6cb13b Compare September 27, 2024 15:34
@0xavi0 0xavi0 self-assigned this Sep 27, 2024
@0xavi0 0xavi0 marked this pull request as ready for review September 27, 2024 16:06
@0xavi0 0xavi0 requested a review from a team as a code owner September 27, 2024 16:06
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 3 times, most recently from 2a532e9 to 9afd993 Compare September 30, 2024 14:55
Changes the job handling so jobs are deleted after they succeed.
Jobs are created when they are needed, this avoids having always a minimum of 1 job per
`gitrepo` resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting
the controller reference when creating the job and the Owns statement makes extra reconciler
calls that are not needed.

Signed-off-by: Xavi Garcia <[email protected]>
Signed-off-by: Xavi Garcia <[email protected]>
@0xavi0 0xavi0 requested a review from weyfonk October 1, 2024 07:18
@0xavi0 0xavi0 requested a review from weyfonk October 1, 2024 08:05
@0xavi0 0xavi0 merged commit 57c2f83 into rancher:main Oct 1, 2024
12 checks passed
@0xavi0 0xavi0 mentioned this pull request Oct 2, 2024
3 tasks
@kkaempf kkaempf added this to the v2.10.0 milestone Oct 2, 2024
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 3, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
rancher#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <[email protected]>
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 4, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
rancher#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants